<!DOCTYPE html>
<html lang="zh" dir="ltr" class="client-nojs">
<head>
<title>字符集与编码</title>
<meta charset="UTF-8">
<meta name="generator" content="MediaWiki 1.21.2">
<link rel="shortcut icon" href="../../../common/favicon.ico">
<link rel="stylesheet" href="../../../common/ext.css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" href="../../../common/site_modules.css">
<style>a:lang(ar),a:lang(ckb),a:lang(fa),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none}#toc{display:none}.editsection{display:none}
/* cache key: mwiki1-mwiki_zh_:resourceloader:filter:minify-css:7:15cea3ec788a65b5187d4018eed543bf */</style>

<script src="../../../common/startup_scripts.js"></script>
<script>if(window.mw){
mw.config.set({"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"cpp/language/charset","wgTitle":"cpp/language/charset","wgCurRevisionId":72972,"wgArticleId":13886,"wgIsArticle":true,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[],"wgBreakFrames":false,"wgPageContentLanguage":"zh","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"zh","wgMonthNames":["","1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],"wgMonthNamesShort":["","1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],"wgRelevantPageName":"cpp/language/charset","wgUserVariant":"zh","wgRestrictionEdit":[],"wgRestrictionMove":[]});
}</script><script>if(window.mw){
mw.loader.implement("user.options",function(){mw.user.options.set({"ccmeonemails":0,"cols":80,"date":"default","diffonly":0,"disablemail":0,"disablesuggest":0,"editfont":"default","editondblclick":0,"editsection":0,"editsectiononrightclick":0,"enotifminoredits":0,"enotifrevealaddr":0,"enotifusertalkpages":1,"enotifwatchlistpages":0,"extendwatchlist":0,"externaldiff":0,"externaleditor":0,"fancysig":0,"forceeditsummary":0,"gender":"unknown","hideminor":0,"hidepatrolled":0,"imagesize":2,"justify":0,"math":1,"minordefault":0,"newpageshidepatrolled":0,"nocache":0,"noconvertlink":0,"norollbackdiff":0,"numberheadings":0,"previewonfirst":0,"previewontop":1,"quickbar":5,"rcdays":7,"rclimit":50,"rememberpassword":0,"rows":25,"searchlimit":20,"showhiddencats":0,"showjumplinks":1,"shownumberswatching":1,"showtoc":0,"showtoolbar":1,"skin":"cppreference2","stubthreshold":0,"thumbsize":2,"underline":2,"uselivepreview":0,"usenewrc":0,"watchcreations":0,"watchdefault":0,"watchdeletion":0,
"watchlistdays":3,"watchlisthideanons":0,"watchlisthidebots":0,"watchlisthideliu":0,"watchlisthideminor":0,"watchlisthideown":0,"watchlisthidepatrolled":0,"watchmoves":0,"wllimit":250,"variant":"zh","language":"zh","searchNs0":true,"searchNs1":false,"searchNs2":false,"searchNs3":false,"searchNs4":false,"searchNs5":false,"searchNs6":false,"searchNs7":false,"searchNs8":false,"searchNs9":false,"searchNs10":false,"searchNs11":false,"searchNs12":false,"searchNs13":false,"searchNs14":false,"searchNs15":false,"gadget-MathJax":1,"gadget-ColiruCompiler":1});;},{},{});mw.loader.implement("user.tokens",function(){mw.user.tokens.set({"editToken":"+\\","patrolToken":false,"watchToken":false});;},{},{});
/* cache key: mwiki1-mwiki_zh_:resourceloader:filter:minify-js:7:258d7cd6aa9aa67dee25e01fb6a9e505 */
}</script>
<script>if(window.mw){
mw.loader.load(["mediawiki.page.startup","mediawiki.legacy.wikibits","mediawiki.legacy.ajax"]);
}</script>
<!--[if lt IE 7]><style type="text/css">body{behavior:url("/mwiki/skins/cppreference2/csshover.min.htc")}</style><![endif]--></head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-cpp_language_charset skin-cppreference2 action-view cpp-navbar">
        <!-- header -->
        <!-- /header -->
        <!-- content -->
<div id="cpp-content-base">
            <div id="content">
                <a id="top"></a>
                <div id="mw-js-message" style="display:none;"></div>
                                <!-- firstHeading -->
<h1 id="firstHeading" class="firstHeading">字符集与编码</h1>
                <!-- /firstHeading -->
                <!-- bodyContent -->
                <div id="bodyContent">
                                        <!-- tagline -->
                    <div id="siteSub">来自cppreference.com</div>
                    <!-- /tagline -->
                                        <!-- subtitle -->
                    <div id="contentSub"><span class="subpages">&lt; <a href="../../cpp.html" title="cpp">cpp</a>‎ | <a href="../language.html" title="cpp/language">language</a></span></div>
                    <!-- /subtitle -->
                                                            <!-- bodycontent -->
                    <div id="mw-content-text" lang="zh" dir="ltr" class="mw-content-ltr"><div class="t-navbar" style=""><div class="t-navbar-sep"> </div><div class="t-navbar-head"><a href="../../cpp.html" title="cpp"> C++</a><div class="t-navbar-menu"><div><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="../language.html" title="cpp/language">语言</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../header.html" title="cpp/header">标准库头文件</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../freestanding.html" title="cpp/freestanding"> 自立与有宿主实现</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../named_req.html" title="cpp/named req">具名要求</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../utility.html#.E8.AF.AD.E8.A8.80.E6.94.AF.E6.8C.81" title="cpp/utility">语言支持库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../concepts.html" title="cpp/concepts">概念库</a> <span class="t-mark-rev t-since-cxx20">(C++20)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../error.html" title="cpp/error">诊断库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../utility.html" title="cpp/utility">工具库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../string.html" title="cpp/string">字符串库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../container.html" title="cpp/container">容器库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../iterator.html" title="cpp/iterator">迭代器库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../ranges.html" title="cpp/ranges"> 范围库</a> <span class="t-mark-rev t-since-cxx20">(C++20)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../algorithm.html" title="cpp/algorithm">算法库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../numeric.html" title="cpp/numeric">数值库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../locale.html" title="cpp/locale">本地化库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../io.html" title="cpp/io">输入/输出库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../filesystem.html" title="cpp/filesystem">文件系统库</a> <span class="t-mark-rev t-since-cxx17">(C++17)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../regex.html" title="cpp/regex">正则表达式库</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../atomic.html" title="cpp/atomic">原子操作库</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../thread.html" title="cpp/thread">线程支持库</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../experimental.html" title="cpp/experimental">技术规范</a> </td></tr>
</table></div><div></div></div></div></div><div class="t-navbar-sep"> </div><div class="t-navbar-head"><a href="../language.html" title="cpp/language">C++ 语言</a></div><div class="t-navbar-sep"> </div><div class="t-navbar-head"><a href="basic_concepts.html" title="cpp/language/basic concepts">基本概念</a><div class="t-navbar-menu"><div><div style="display:inline-block">
<div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="../keywords.html" title="cpp/keyword"> 语言关键词</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <strong class="selflink"> 字符集与编码</strong> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="translation_phases.html" title="cpp/language/translation phases"> 翻译阶段</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../comments.html" title="cpp/comment"> 注释</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="main_function.html" title="cpp/language/main function"> <code>main()</code> 函数</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="punctuators.html" title="cpp/language/punctuators"> 标点</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="name.html" title="cpp/language/identifiers"> 名字和标识符</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="incomplete_type.html" title="cpp/language/type"> 类型</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="types.html" title="cpp/language/types"> 基础类型</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="object.html" title="cpp/language/object"> 对象</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="scope.html" title="cpp/language/scope"> 作用域</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="lifetime.html" title="cpp/language/lifetime"> 对象生存期</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="storage_duration.html" title="cpp/language/storage duration"> 存储期与连接</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="definition.html" title="cpp/language/definition"> 定义和单一定义规则（ODR）</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="lookup.html" title="cpp/language/lookup"> 名字查找</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="qualified_lookup.html" title="cpp/language/qualified lookup"> 有限定名字查找</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="unqualified_lookup.html" title="cpp/language/unqualified lookup"> 无限定名字查找</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="as_if.html" title="cpp/language/as if"> “如同”规则</a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="ub.html" title="cpp/language/ub"> 未定义行为</a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="memory_model.html" title="cpp/language/memory model"> 内存模型</a> </td></tr>
</table></div>
</div><div></div></div></div></div><div class="t-navbar-sep"> </div></div>
<h3><span class="mw-headline" id=".E5.BD.93.E5.89.8D.E5.AD.97.E7.AC.A6.E9.9B.86_.28C.2B.2B23_.E8.B5.B7.29">当前字符集 <span class="t-mark-rev t-since-cxx23">(C++23 起)</span></span></h3>
<h4><span class="mw-headline" id=".E7.BF.BB.E8.AF.91.E5.AD.97.E7.AC.A6.E9.9B.86">翻译字符集</span></h4>
<p><i>翻译字符集</i> 含有以下元素:
</p>
<ul><li> 每个由 ISO/IEC 10646 命名的字符，通过它独特的 UCS 标量值标识，和
</li><li> 没有赋予命名字符的 UCS 标量对应的每个不同的字符
</li></ul>
<h4><span class="mw-headline" id=".E5.9F.BA.E7.A1.80.E5.AD.97.E7.AC.A6.E9.9B.86">基础字符集</span></h4>
<p><i>基础字符集</i> 是翻译字符集的一个子集，它含有以下96个字符：
</p>
<table class="wikitable" style="text-align: left;">

<tr>
<th> 代码单元 </th>
<th> 字符 </th>
<th> 字形
</th></tr>
<tr>
<td>U+0009</td>
<td>横向制表</td>
<td>
</td></tr>
<tr>
<td>U+000B</td>
<td>纵向制表</td>
<td>
</td></tr>
<tr>
<td>U+000C</td>
<td>换页（FF）</td>
<td>
</td></tr>
<tr>
<td>U+0020</td>
<td>空格</td>
<td>
</td></tr>
<tr>
<td>U+000A</td>
<td>换行（LF）</td>
<td>新行
</td></tr>
<tr>
<td>U+0021</td>
<td>感叹号</td>
<td><code><b>!</b></code>
</td></tr>
<tr>
<td>U+0022</td>
<td>问号</td>
<td><code><b>"</b></code>
</td></tr>
<tr>
<td>U+0023</td>
<td>数字符号</td>
<td><code><b>#</b></code>
</td></tr>
<tr>
<td>U+0025</td>
<td>百分号</td>
<td><code><b>%</b></code>
</td></tr>
<tr>
<td>U+0026</td>
<td>和号</td>
<td><code><b>&amp;</b></code>
</td></tr>
<tr>
<td>U+0027</td>
<td>撇号</td>
<td><code><b>'</b></code>
</td></tr>
<tr>
<td>U+0028</td>
<td>左圆括号</td>
<td><code><b>(</b></code>
</td></tr>
<tr>
<td>U+0029</td>
<td>右圆括号</td>
<td><code><b>)</b></code>
</td></tr>
<tr>
<td>U+002A</td>
<td>星号</td>
<td><code><b>*</b></code>
</td></tr>
<tr>
<td>U+002B</td>
<td>加号</td>
<td><code><b>+</b></code>
</td></tr>
<tr>
<td>U+002C</td>
<td>逗号</td>
<td><code><b>,</b></code>
</td></tr>
<tr>
<td>U+002D</td>
<td>连字符/减号</td>
<td><code><b>-</b></code>
</td></tr>
<tr>
<td>U+002E</td>
<td>句号</td>
<td><code><b>.</b></code>
</td></tr>
<tr>
<td>U+002F</td>
<td>斜线</td>
<td><code><b>/</b></code>
</td></tr>
<tr>
<td>U+0030 .. U+0039</td>
<td>数位 零到九</td>
<td><code><b>0 1 2 3 4 5 6 7 8 9</b></code>
</td></tr>
<tr>
<td>U+003A</td>
<td>冒号</td>
<td><code><b>:</b></code>
</td></tr>
<tr>
<td>U+003B</td>
<td>分号</td>
<td><code><b>;</b></code>
</td></tr>
<tr>
<td>U+003C</td>
<td>小于号</td>
<td><code><b>&lt;</b></code>
</td></tr>
<tr>
<td>U+003D</td>
<td>等号</td>
<td><code><b>=</b></code>
</td></tr>
<tr>
<td>U+003E</td>
<td>大于号</td>
<td><code><b>&gt;</b></code>
</td></tr>
<tr>
<td>U+003F</td>
<td>问号</td>
<td><code><b>?</b></code>
</td></tr>
<tr>
<td>U+0041 .. U+005A</td>
<td>拉丁大写字母 A到Z</td>
<td><code><b>A B C D E F G H I J K L M</b>
<p><b>N O P Q R S T U V W X Y Z</b></p></code>

</td></tr>
<tr>
<td>U+005B</td>
<td>左方括号</td>
<td><code><b>[</b></code>
</td></tr>
<tr>
<td>U+005C</td>
<td>反斜线</td>
<td><code><b>\</b></code>
</td></tr>
<tr>
<td>U+005D</td>
<td>右方括号</td>
<td><code><b>]</b></code>
</td></tr>
<tr>
<td>U+005E</td>
<td>抑扬音符号</td>
<td><code><b>^</b></code>
</td></tr>
<tr>
<td>U+005F</td>
<td>下划线</td>
<td><code><b>_</b></code>
</td></tr>
<tr>
<td>U+0061 .. U+007A</td>
<td>拉丁小写字母 a到z</td>
<td><code><b>a b c d e f g h i j k l m</b>
<p><b>n o p q r s t u v w x y z</b></p></code>

</td></tr>
<tr>
<td>U+007B</td>
<td>左波形括号</td>
<td><code><b>{</b></code>
</td></tr>
<tr>
<td>U+007C</td>
<td>竖线</td>
<td><code><b>|</b></code>
</td></tr>
<tr>
<td>U+007D</td>
<td>右波形括号</td>
<td><code><b>}</b></code>
</td></tr>
<tr>
<td>U+007E</td>
<td>波浪符</td>
<td><code><b>~</b></code>
</td></tr></table>
<h4><span class="mw-headline" id=".E5.9F.BA.E7.A1.80.E5.AD.97.E9.9D.A2.E9.87.8F.E5.AD.97.E7.AC.A6.E9.9B.86">基础字面量字符集</span></h4>
<p><i>基础字面量字符集</i> 含有基础字符集的所有字符，外加以下控制字符：
</p>
<table class="wikitable" style="text-align: left;">

<tr>
<th> 代码单元 </th>
<th> 字符
</th></tr>
<tr>
<td>U+0000</td>
<td>空
</td></tr>
<tr>
<td>U+0007</td>
<td>响铃
</td></tr>
<tr>
<td>U+0008</td>
<td>退格
</td></tr>
<tr>
<td>U+000D</td>
<td>回车（CR）
</td></tr></table>
<h4><span class="mw-headline" id=".E6.89.A7.E8.A1.8C.E5.AD.97.E7.AC.A6.E9.9B.86">执行字符集</span></h4>
<p><i>执行字符集</i> 和 <i>执行宽字符集</i> 是基础字面量字符集的超集。执行字符集的编码和额外元素（如果存在）的集合受地区设定影响。
</p>
<h4><span class="mw-headline" id=".E4.BB.A3.E7.A0.81.E5.8D.95.E5.85.83.E4.B8.8E.E5.AD.97.E9.9D.A2.E9.87.8F.E7.BC.96.E7.A0.81">代码单元与字面量编码</span></h4>
<p><i>代码单元</i> 是字符类型的一个整数值。在除了多字符和不可编码字符字面量以外的<a href="character_literal.html" title="cpp/language/character literal">字符字面量</a>中的字符，和在<a href="string_literal.html" title="cpp/language/string literal">字符串字面量</a>中的字符会以编码前缀被编码为一个含有一个或多个编码单元的序列，这被称为对应的 <i>字面量编码</i>。
</p><p>字面量编码或执行字符集的受地区设定影响的编码会将基础字面量字符集的每个元素编码为一个具有非负值的代码单元，而且它与其他任何元素编码的代码单元都不相同。基础字面量字符集以外的字符可以被编码为多个代码单元；这样编码出来的某个编码单元可以和基础字面量字符集中的字符编码的编码单元一致。执行字符集的编码可以和任何字面量编码都不相关。
</p><p>通常字面量编码是应用到通常字符字面量和通常字符串字面量的编码。宽字面量编码是应用到宽字符字面量和宽字符串字面量的编码。
</p><p>U+0000 会被编码为零值。翻译字符集的其他任何元素都不能被编码为具有零值的代码单元。每个数位零（U+0030）后的数位字符的代码单元值都应该比上一个字符的值大一。 通常字面量编码和宽字面量编码的其他部分都由实现定义。
</p><p>对于 UTF-8，UTF-16 和 UTF-32 字面量，翻译字符集中每个字符对应的 UCS 标量值都会以 ISO/IEC 10646 中分别对应的 UCS 编码形式的说明进行编码。
</p>
<h3><span class="mw-headline" id="C.2B.2B23_.E5.89.8D.E7.9A.84.E5.AD.97.E7.AC.A6.E9.9B.86_.28C.2B.2B23_.E5.89.8D.29">C++23 前的字符集 <span class="t-mark-rev t-until-cxx23">(C++23 前)</span></span></h3>
<h4><span class="mw-headline" id=".E5.9F.BA.E7.A1.80.E6.BA.90.E5.AD.97.E7.AC.A6.E9.9B.86">基础源字符集</span></h4>
<p><i>基础源字符集</i> 含有以下96个字符：
</p>
<ul><li> 空格字符，
</li><li> 表示以下内容的控制字符：
<ul><li> 横向制表符，
</li><li> 纵向制表符，
</li><li> 换页，
</li><li> 以及换行，
</li></ul>
</li><li> 外加以下91个图形字符：
</li></ul>
<table class="wikitable" style="text-align: center;">

<tr>
<td><code>a</code></td>
<td><code>b</code></td>
<td><code>c</code></td>
<td><code>d</code></td>
<td><code>e</code></td>
<td><code>f</code></td>
<td><code>g</code></td>
<td><code>h</code></td>
<td><code>i</code></td>
<td><code>j</code></td>
<td><code>k</code></td>
<td><code>l</code></td>
<td><code>m</code></td>
<td><code>n</code></td>
<td><code>o</code></td>
<td><code>p</code></td>
<td><code>q</code></td>
<td><code>r</code></td>
<td><code>s</code></td>
<td><code>t</code></td>
<td><code>u</code></td>
<td><code>v</code></td>
<td><code>w</code></td>
<td><code>x</code></td>
<td><code>y</code></td>
<td><code>z</code>
</td></tr>
<tr>
<td><code>A</code></td>
<td><code>B</code></td>
<td><code>C</code></td>
<td><code>D</code></td>
<td><code>E</code></td>
<td><code>F</code></td>
<td><code>G</code></td>
<td><code>H</code></td>
<td><code>I</code></td>
<td><code>J</code></td>
<td><code>K</code></td>
<td><code>L</code></td>
<td><code>M</code></td>
<td><code>N</code></td>
<td><code>O</code></td>
<td><code>P</code></td>
<td><code>Q</code></td>
<td><code>R</code></td>
<td><code>S</code></td>
<td><code>T</code></td>
<td><code>U</code></td>
<td><code>V</code></td>
<td><code>W</code></td>
<td><code>X</code></td>
<td><code>Y</code></td>
<td><code>Z</code>
</td></tr>
<tr>
<td><code>0</code></td>
<td><code>1</code></td>
<td><code>2</code></td>
<td><code>3</code></td>
<td><code>4</code></td>
<td><code>5</code></td>
<td><code>6</code></td>
<td><code>7</code></td>
<td><code>8</code></td>
<td><code>9</code>
</td></tr>
<tr>
<td><code>_</code></td>
<td><code>{</code></td>
<td><code></code>}</td>
<td><code>[</code></td>
<td><code>]</code></td>
<td><code>#</code></td>
<td><code>(</code></td>
<td><code>)</code></td>
<td><code>&lt;</code></td>
<td><code>&gt;</code></td>
<td><code>%</code></td>
<td><code>:</code></td>
<td><code>;</code></td>
<td><code>.</code></td>
<td><code>?</code></td>
<td><code>*</code></td>
<td><code>+</code></td>
<td><code>-</code></td>
<td><code>/</code></td>
<td><code>^</code></td>
<td><code>&amp;</code></td>
<td><code>|</code></td>
<td><code>~</code></td>
<td><code>!</code></td>
<td><code>=</code></td>
<td><code>,</code></td>
<td><code>\</code></td>
<td><code>"</code></td>
<td><code>’</code>
</td></tr></table>
<p>基础源字符集的成员的字形是为了标识 ISO/IEC 10646 中对应 ASCII 字符集的子集的字符。然而由于从源文件的字符到源字符集的映射（在<a href="translation_phases.html#.E9.98.B6.E6.AE.B5_1" title="cpp/language/translation phases">翻译阶段1</a>中所述）由实现决定，因此实现需要在其文档记载基础源字符如何在源文件里表示。
</p>
<h4><span class="mw-headline" id=".E5.9F.BA.E7.A1.80.E6.89.A7.E8.A1.8C.E5.AD.97.E7.AC.A6.E9.9B.86">基础执行字符集</span></h4>
<p><i>基础执行字符集</i> 和 <i>基础执行宽字符集</i> 包含基础源字符集的所有成员，外加表示警报（响铃），退格和回车的控制字符，以及值为 0 的空字符（对应的有空宽字符）。
</p><p>对于每个基础执行字符集，成员的值均不得为负，且各不相同。在基础源字符集和基础执行字符集中，在上述列表中的数位列表里每个 0 之后的字符的值都应该比上一个字符的值大一。
</p>
<h4><span class="mw-headline" id=".E6.89.A7.E8.A1.8C.E5.AD.97.E7.AC.A6.E9.9B.86.EF.BC.88.E6.97.A7.E5.AE.9A.E4.B9.89.EF.BC.89">执行字符集（旧定义）</span></h4>
<p><i>执行字符集</i> 和 <i>执行宽字符集</i> 分别是基础执行字符集和基础执行宽字符集的由实现定义的超集。执行字符集的成员的值和额外成员的集合受地区设定影响。
</p>
<h3><span class="mw-headline" id=".E5.8F.82.E9.98.85">参阅</span></h3>
<table class="t-dsc-begin">

<tr class="t-dsc">
<td colspan="2">  <a href="ascii.html" title="cpp/language/ascii">ASCII 码表</a>
</td></tr>

</table>

<!-- 
NewPP limit report
Preprocessor visited node count: 1355/1000000
Preprocessor generated node count: 4312/1000000
Post‐expand include size: 33169/2097152 bytes
Template argument size: 3273/2097152 bytes
Highest expansion depth: 13/40
Expensive parser function count: 0/100
-->

<!-- Saved in parser cache with key mwiki1-mwiki_zh_:pcache:idhash:13886-0!*!0!!zh!*!zh!* and timestamp 20211214193301 -->
</div>                    <!-- /bodycontent -->
                                        <!-- printfooter -->
                    <div class="printfooter">
                    来自“<a href="https://zh.cppreference.com/mwiki/index.php?title=cpp/language/charset&amp;oldid=72972">https://zh.cppreference.com/mwiki/index.php?title=cpp/language/charset&amp;oldid=72972</a>”                    </div>
                    <!-- /printfooter -->
                                                            <!-- catlinks -->
                    <!-- /catlinks -->
                                                            <div class="visualClear"></div>
                    <!-- debughtml -->
                                        <!-- /debughtml -->
                </div>
                <!-- /bodyContent -->
            </div>
        </div>
        <!-- /content -->
        <!-- footer -->
        <div id="cpp-footer-base" class="noprint">
            <div id="footer">
                        <div id="cpp-navigation">
            <h5>导航</h5>
            <ul><li><a href="https://zh.cppreference.com/w/cpp/language/charset">Online version</a></li><li>Offline version retrieved 2022-01-01 00:37.</li></ul></div>
                        <ul id="footer-info">
                                    <li id="footer-info-lastmod"> 本页面最后修改于2021年11月18日 (星期四) 21:50。</li>
                                    <li id="footer-info-viewcount">此页面已被浏览过237次。</li>
                            </ul>
                    </div>
        </div>
        <!-- /footer -->
        <script>if(window.mw){
mw.loader.state({"site":"loading","user":"missing","user.groups":"ready"});
}</script>
<script src="../../../common/skin_scripts.js"></script>
<script>if(window.mw){
mw.loader.load(["mediawiki.action.view.postEdit","mediawiki.user","mediawiki.page.ready","mediawiki.searchSuggest","mediawiki.hidpi","ext.gadget.MathJax","ext.gadget.ColiruCompiler"], null, true);
}</script>
<script src="../../../common/site_scripts.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2828341-1']);
_gaq.push(['_setDomainName', 'cppreference.com']);
_gaq.push(['_trackPageview']);
</script><!-- Served in 0.198 secs. -->
	</body>
<!-- Cached 20211214193301 -->
</html>